#ifndef __CAMERA_CONTROLLER_HPP__
#define __CAMERA_CONTROLLER_HPP__

namespace m3g
{
    class Camera;
}

namespace m3g_viewer
{


/**
 *
 */
class CameraController
{
    struct SphericalCoord {
        SphericalCoord (float r_, float th_) : r(r_), th(th_) {};
        float r;
        float th;
    };

public:
    CameraController ();
    ~CameraController ();

    void set_camera (m3g::Camera* cam);

    void move_forward ();

    void move_back ();

    void move_right ();

    void move_left ();

    void move_up ();

    void move_down ();

    void turn_right ();

    void turn_left ();

    void turn_up ();

    void turn_down ();

    void get_camera_pos (float* pos) const;

    void get_camera_lookat (float* lookat) const;

    void get_camera_up (float* up) const;

private:
    m3g::Camera* camera;

    SphericalCoord pos;
    SphericalCoord lookat;
};


} // namespace m3g_viewer

#endif

